<template>
	  <view :ikey="ikey" style="display: inline-block;">
		  <img :src="customIconLinkComp" :style="`width:${props.width}px;height:${props.height}px;`" >
	  </view>
</template>

<script>
import { defineComponent,ref,onMounted,computed } from 'vue';
export default defineComponent({
  name: 'CustomIcon',
});
</script>
<script setup>
	import { customIconLinkPrefix } from '../../libs/baseUrl.js'
	// props
	const props = defineProps(['name','width','height','ikey'])
	
	// const ikey 
	const ikey = ref( Math.floor(Math.random() * (1 - 100 + 1) + 1))
	
	// 自定义图标链接拼接计算属性
	const customIconLinkComp = computed(()=>{
		return `${customIconLinkPrefix}${props.name}.svg`
	})
	
	onMounted(()=>{
		// setTimeout(()=>{
		// 	ikey.value = props.ikey
		// },400)
		console.log(props.ikey);
	})

</script>

<style lang="scss" scoped></style>
